package com.martin.fast_frame_compose.page.dialog.bottom

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.martin.lib_base.ui.screen.CommonBottomDialog
import com.martin.lib_base.ui.screen.CommonButton

@Composable
fun BottomDemoDialog(
    model: BottomDemoDialogModel,
) {
    CommonBottomDialog(model.showState.value, { model.showState.value = false }) {
        Column(
            modifier = Modifier
                .fillMaxWidth()
                .background(Color.White, RoundedCornerShape(topStart = 10.dp, topEnd = 10.dp))
                .padding(10.dp)
        ) {
            Text(
                "输入弹窗",
                modifier = Modifier,
                fontSize = 18.sp,
                fontWeight = FontWeight.Bold
            )

            OutlinedTextField(
                model.message.value,
                { model.message.value = it },
                modifier = Modifier.padding(top = 15.dp)
            )

            CommonButton(
                paddingHorizontal = 15.dp,
                paddingTop = 10.dp,
                paddingBottom = 10.dp
            ) {
                model.onConfirmClick()
            }
        }
    }
}